<!DOCTYPE html>
<?php session_start(); ?>
<html>
	<head>
		<title>AddBooks</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="index.css" type="text/css" rel="stylesheet" media="screen" />
		<link href="css/addbook.css" type="text/css" rel="stylesheet" media="screen" />
	</head>
	<body>
		<?php
		if(!isset($_SESSION["session_username"]))
		{
			header("location:RegisterSite.php");
			exit();
		}
		$logname = $_SESSION["session_username"];
		?>
		<div class="topbar">
			<div class="loginfo">
				<ul>
					<li>
						<?=$logname?>
						<?php
							if(isset($_SESSION["session_admin"]) && $_SESSION["session_admin"] == true)
							{
						?>
							<input type="button" value="用户管理" onclick="window.location.href ='UserControl.php'"/>
						<?php
							}
                        ?>
						<input type="button" value="注销" onclick="window.location.href ='Logout.php'"/>
					</li>
				</ul>
			</div>
			<div class="globalitems">
				<ul>
					<li>
						<a href="index.php">首页</a>
					</li>
					<li>
						<a href="SearchBook.php?allbook=true">书库</a>
					</li>
					<li>
						<a href="showGroup.php">我的群组</a>
						</li>
						<li>
							<a href="index.php">随便看看</a>
						</li>
					</ul>
				</div>
			</div>
			
			
		<div id="addbkdiv">
			<form action="AddBookToDB.php" method="post" enctype="multipart/form-data">
				<fieldset id="addbk">
				<legend><span id="addbktitle">上传图书:</span></legend>
					<div class="event">书名<input type="text" name="newbkname"/></div>
					<div class="event">标签<input type="text" name="newbktag"/></div>
					<div class="event">简介<textarea name="newbkintro"></textarea></div>
					<div class="event">封面<input type="file" name="newbkface"/></div>
					<div class="event"><input type="submit" value="上传"/></div>
				</fieldset>
			</form>
		</div>
	</body>
</html>